package cate.game.role.bag.favorability;

import cate.game.attr.FightAttr;
import cate.game.attr.PowerAttrPart;
import cate.game.play.support.PlayBuildContext;


public class FavorabilityPowerAttrPart extends PowerAttrPart {

    public FavorabilityPowerAttrPart() {}

    public FavorabilityPowerAttrPart(PlayBuildContext ctx, FavorabilityOn po) {
        if (po != null && po.owner != null && !po.favorabilitysAttrs.isEmpty()) {
            for (FavorabilityAttr attr : po.favorabilitysAttrs) {
                if (attr != null && attr.value > 0) {
                    String attrStr = attr.attrId + ":" + attr.value;
                    super.attr.add(new FightAttr(attrStr));
                }
            }
        }
    }
}
